package com.thomas.client;

import java.util.Date;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;



@RestController
@RequestMapping("/hello")
public class HelloController {

    @Value("${server.port}")
    String port;

    @Value("${config.producer.instance:0}")
    private int instance;
    
    Log LOG = LogFactory.getLog(HelloController.class);
    
    @GetMapping("/")
    public String hello(@RequestParam String name) {
    	LOG.info("== Producer ==");
        return "[" + instance + "]" + "Hello, " + name + " , Server " + port + " is sevicing you.";
    }

}
